<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS-数据类型</title>
</head>
<body>
    
</body>
<script>
    <!-- 原始数据类型 -->
    alert(typeof 123); //number
    alert(typeof 3.14); //number
    alert(typeof "hello"); //string
    alert(typeof true); //boolean
    alert(typeof undefined); //undefined
    alert(typeof null); //object
    alert(typeof {}); //object
    alert(typeof []); //object
    alert(typeof function(){}); //function
    alert(typeof NaN); //number

    var a;
    alert(typeof a); //undefined
</script>
</html>